﻿using System;
using System.Threading;
using System.Windows.Forms;
using DesktopTest.UI;
using Egeye.AddIn;

namespace DesktopTest
{
    [Serializable]
    [AddIn("DesktopAddIn")]
    public class DesktopAddIn : AddInBase
    {
        public override void Start(IBundleContext context)
        {
            LaunchDesktop();
        }

        public override void Stop(IBundleContext context)
        {
            
        }

        private void LaunchDesktop()
        {
            ThreadStart start = new ThreadStart(LaunchDesktopRun);
            Thread uiThread = new Thread(start);
            uiThread.IsBackground = false;
            uiThread.Start();
        }

        private void LaunchDesktopRun()
        {
            Form desktopWindow = new DesktopForm();
            Application.Run(desktopWindow);
        }
    }
}
